# -*- coding: utf-8 -*-
"""
@Time ： 2021/8/2 20:26
@Auth ： Mr.掌心 2929184523
@Company ：特斯汀学院 @testingedu.com.cn
@Function ：yaml keywordframework
"""

import os
from time import sleep

import pytest
import yaml
from selenium import webdriver
from selenium.webdriver.remote.webdriver import WebDriver

from My_Keywords.keyword import Web
from PO.pages.login_page import LoginPage

file = open('keywords.yaml', 'r', encoding='utf-8')
cases_dict = yaml.safe_load(file)
print(cases_dict)

# class test_demo:
#     def run_step(self, func, value):
#         func(*value)
#
#     def setup_class(self):
#         self.web = Web()
#         self.web.openbrowser()
#
#     def test_login(self, cases):
#         cases = cases['cases']
#         print(cases)
#         for case in cases:
#             func = self.web.__getattribute__(case['action'])
#             caselist = list(case.values())
#             print(caselist)
#             self.run_step(func, caselist[2:])
#
#     def teardown_class(self):
#         self.web.quit()
"""
1.合理的设计：框架+语言；老功能（比较稳定功能） OR 1级测试用例
2.CI/CD
3.app UI + 遍历工具 
"""